import Vue from 'vue'
import VueRouter from 'vue-router'
import Welcome from '../components/Welcome'
import Home from '../components/Home.vue'
import GoodsInfo from '../components/goods/GoodsInfo'

Vue.use(VueRouter)

const routes = [
  { path: '/', redirect: '/welcome' },
  {
    path: '/welcome',
    component: Welcome,
    redirect: '/home',
    children: [
      { path: '/home', component: Home },
      { path: '/goodsinfo', component: GoodsInfo }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
